package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class IOCopyDemo {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("image.jpg");
        FileOutputStream fos = new FileOutputStream("image2.jpg");
        int d ;
        while ((d=fis.read()) != -1 ){
            fos.write(d);
        }
        long end = System.currentTimeMillis();
        fis.close();
        fos.close();
        System.out.println("耗时"+(end-start));
    }
}
